home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib / tk / winfo.man < prev    next >
Encoding:
Text File  |  1992-08-24  |  10.2 KB  |  370 lines

  1. '\"
  2. '\" Copyright 1990 Regents of the University of California
  3. '\" Permission to use, copy, modify, and distribute this
  4. '\" documentation for any purpose and without fee is hereby
  5. '\" granted, provided that this notice appears in all copies.
  6. '\" The University of California makes no representations about
  7. '\" the suitability of this material for any purpose.  It is
  8. '\" provided "as is" without express or implied warranty.
  9. '\" 
  10. '\" $Header: /user6/ouster/wish/man/RCS/winfo.man,v 1.14 92/06/03 14:37:57 ouster Exp $ SPRITE (Berkeley)
  11. '/" 
  12. .\" The definitions below are for supplemental macros used in Sprite
  13. .\" manual entries.
  14. .\"
  15. .\" .HS name section [date [version]]
  16. .\"    Replacement for .TH in other man pages.  See below for valid
  17. .\"    section names.
  18. .\"
  19. .\" .AP type name in/out [indent]
  20. .\"    Start paragraph describing an argument to a library procedure.
  21. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  22. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  23. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  24. .\"    needed;  use .AS below instead)
  25. .\"
  26. .\" .AS [type [name]]
  27. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  28. .\"    name are examples of largest possible arguments that will be passed
  29. .\"    to .AP later.  If args are omitted, default tab stops are used.
  30. .\"
  31. .\" .BS
  32. .\"    Start box enclosure.  From here until next .BE, everything will be
  33. .\"    enclosed in one large box.
  34. .\"
  35. .\" .BE
  36. .\"    End of box enclosure.
  37. .\"
  38. .\" .VS
  39. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  40. .\"    of man pages.
  41. .\"
  42. .\" .VE
  43. .\"    End of vertical sidebar.
  44. .\"
  45. .\" .DS
  46. .\"    Begin an indented unfilled display.
  47. .\"
  48. .\" .DE
  49. .\"    End of indented unfilled display.
  50. .\"
  51. '\"    # Heading for Sprite man pages
  52. .de HS
  53. .if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
  54. .if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
  55. .if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
  56. .if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
  57. .if t .wh -1.3i ^B
  58. .nr ^l \\n(.l
  59. .ad b
  60. ..
  61. '\"    # Start an argument description
  62. .de AP
  63. .ie !"\\$4"" .TP \\$4
  64. .el \{\
  65. .   ie !"\\$2"" .TP \\n()Cu
  66. .   el          .TP 15
  67. .\}
  68. .ie !"\\$3"" \{\
  69. .ta \\n()Au \\n()Bu
  70. \&\\$1    \\fI\\$2\\fP    (\\$3)
  71. .\".b
  72. .\}
  73. .el \{\
  74. .br
  75. .ie !"\\$2"" \{\
  76. \&\\$1    \\fI\\$2\\fP
  77. .\}
  78. .el \{\
  79. \&\\fI\\$1\\fP
  80. .\}
  81. .\}
  82. ..
  83. '\"    # define tabbing values for .AP
  84. .de AS
  85. .nr )A 10n
  86. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  87. .nr )B \\n()Au+15n
  88. .\"
  89. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  90. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  91. ..
  92. '\"    # BS - start boxed text
  93. '\"    # ^y = starting y location
  94. '\"    # ^b = 1
  95. .de BS
  96. .br
  97. .mk ^y
  98. .nr ^b 1u
  99. .if n .nf
  100. .if n .ti 0
  101. .if n \l'\\n(.lu\(ul'
  102. .if n .fi
  103. ..
  104. '\"    # BE - end boxed text (draw box now)
  105. .de BE
  106. .nf
  107. .ti 0
  108. .mk ^t
  109. .ie n \l'\\n(^lu\(ul'
  110. .el \{\
  111. .\"    Draw four-sided box normally, but don't draw top of
  112. .\"    box if the box started on an earlier page.
  113. .ie !\\n(^b-1 \{\
  114. \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  115. .\}
  116. .el \}\
  117. \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  118. .\}
  119. .\}
  120. .fi
  121. .br
  122. .nr ^b 0
  123. ..
  124. '\"    # VS - start vertical sidebar
  125. '\"    # ^Y = starting y location
  126. '\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
  127. .de VS
  128. .mk ^Y
  129. .ie n 'mc \s12\(br\s0
  130. .el .nr ^v 1u
  131. ..
  132. '\"    # VE - end of vertical sidebar
  133. .de VE
  134. .ie n 'mc
  135. .el \{\
  136. .ev 2
  137. .nf
  138. .ti 0
  139. .mk ^t
  140. \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  141. .sp -1
  142. .fi
  143. .ev
  144. .\}
  145. .nr ^v 0
  146. ..
  147. '\"    # Special macro to handle page bottom:  finish off current
  148. '\"    # box/sidebar if in box/sidebar mode, then invoked standard
  149. '\"    # page bottom macro.
  150. .de ^B
  151. .ev 2
  152. 'ti 0
  153. 'nf
  154. .mk ^t
  155. .if \\n(^b \{\
  156. .\"    Draw three-sided box if this is the box's first page,
  157. .\"    draw two sides but no top otherwise.
  158. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  159. .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  160. .\}
  161. .if \\n(^v \{\
  162. .nr ^x \\n(^tu+1v-\\n(^Yu
  163. \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  164. .\}
  165. .bp
  166. 'fi
  167. .ev
  168. .if \\n(^b \{\
  169. .mk ^y
  170. .nr ^b 2
  171. .\}
  172. .if \\n(^v \{\
  173. .mk ^Y
  174. .\}
  175. ..
  176. '\"    # DS - begin display
  177. .de DS
  178. .RS
  179. .nf
  180. .sp
  181. ..
  182. '\"    # DE - end display
  183. .de DE
  184. .fi
  185. .RE
  186. .sp .5
  187. ..
  188. .HS winfo cmds
  189. .BS
  190. '\" Note:  do not modify the .SH NAME line immediately below!
  191. .SH NAME
  192. winfo \- Return window-related information
  193. .SH SYNOPSIS
  194. \fBwinfo\fR \fIoption \fR?\fIarg arg ...\fR?
  195. .BE
  196.  
  197. .SH DESCRIPTION
  198. .PP
  199. The \fBwinfo\fR command is used to retrieve information about windows
  200. managed by Tk.  It can take any of a number of different forms,
  201. depending on the \fIoption\fR argument.  The legal forms are:
  202. .TP
  203. \fBwinfo atom \fIname\fR
  204. .VS
  205. Returns a decimal string giving the integer identifier for the
  206. atom whose name is \fIname\fR.  If no atom exists with the name
  207. \fIname\fR then a new one is created.
  208. .TP
  209. \fBwinfo atomname \fIid\fR
  210. Returns the textual name for the atom whose integer identifier is
  211. \fIid\fR.
  212. This command is the inverse of the \fBwinfo atom\fR command.
  213. Generates an error if no such atom exists.
  214. .VE
  215. .TP
  216. \fBwinfo children \fIwindow\fR
  217. Returns a list containing the path names of all the children
  218. of \fIwindow\fR.  Top-level windows are returned as children
  219. of their logical parents.
  220. .TP
  221. \fBwinfo class \fIwindow\fR
  222. Returns the class name for \fIwindow\fR.
  223. .TP
  224. \fBwinfo containing \fIrootX rootY\fR
  225. .VS
  226. Returns the path name for the window containing the point given
  227. by \fIrootX\fR and \fIrootY\fR.
  228. \fIRootX\fR and \fIrootY\fR are specified in screen units (i.e.
  229. any form acceptable to \fBTk_GetPixels\fR) in the coordinate
  230. system of the root window.
  231. If no window in this application contains the point then an empty
  232. string is returned.
  233. In selecting the containing window, children are given higher priority
  234. than parents and among siblings the highest one in the stacking order is
  235. chosen.
  236. .TP
  237. \fBwinfo fpixels \fIwindow\fR \fInumber\fR
  238. Returns a floating-point value giving the number of pixels
  239. in \fIwindow\fR corresponding to the distance given by \fInumber\fR.
  240. \fINumber\fR may be specified in any of the forms acceptable
  241. to \fBTk_GetScreenMM\fR, such as ``2.0c'' or ``1i''.
  242. The return value may be fractional;  for an integer value, use
  243. \fBwinfo pixels\fR.
  244. .VE
  245. .TP
  246. \fBwinfo geometry \fIwindow\fR
  247. Returns the geometry for \fIwindow\fR, in the form
  248. \fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR.  All dimensions are
  249. in pixels.
  250. .TP
  251. \fBwinfo height \fIwindow\fR
  252. Returns a decimal string giving \fIwindow\fR's height in pixels.
  253. .TP
  254. \fBwinfo id \fIwindow\fR
  255. Returns a hexadecimal string indicating the X identifier for \fIwindow\fR.
  256. .TP
  257. \fBwinfo interps\fR
  258. Returns a list whose members are the names of all Tcl interpreters
  259. (e.g. all Tk-based applications) currently registered for the
  260. display of the invoking application.
  261. .TP
  262. \fBwinfo ismapped \fIwindow\fR
  263. Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise.
  264. .TP
  265. \fBwinfo name \fIwindow\fR
  266. Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed
  267. to its full path name).
  268. .VS
  269. The command \fBwinfo name .\fR will return the name of the application.
  270. .VE
  271. .TP
  272. \fBwinfo parent \fIwindow\fR
  273. Returns the path name of \fIwindow\fR's parent, or an empty string
  274. if \fIwindow\fR is the main window of the application.
  275. .TP
  276. \fBwinfo pathname \fIid\fR
  277. Returns the path name of the window whose X identifier is \fIid\fR.
  278. \fIId\fR must be a decimal, hexadecimal, or octal integer and must
  279. correspond to a window in the invoking application.
  280. .TP
  281. \fBwinfo pixels \fIwindow\fR \fInumber\fR
  282. .VS
  283. Returns the number of pixels in \fIwindow\fR corresponding
  284. to the distance given by \fInumber\fR.
  285. \fINumber\fR may be specified in any of the forms acceptable
  286. to \fBTk_GetPixels\fR, such as ``2.0c'' or ``1i''.
  287. The result is rounded to the nearest integer value;  for a
  288. fractional result, use \fBwinfo fpixels\fR.
  289. .VE
  290. .TP
  291. \fBwinfo reqheight \fIwindow\fR
  292. Returns a decimal string giving \fIwindow\fR's requested height,
  293. in pixels.  This is the value used by \fIwindow\fR's geometry
  294. manager to compute its geometry.
  295. .TP
  296. \fBwinfo reqwidth \fIwindow\fR
  297. Returns a decimal string giving \fIwindow\fR's requested width,
  298. in pixels.  This is the value used by \fIwindow\fR's geometry
  299. manager to compute its geometry.
  300. .TP
  301. \fBwinfo rootx \fIwindow\fR
  302. Returns a decimal string giving the x-coordinate, in the root
  303. window of the screen, of the
  304. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  305. has no border).
  306. .TP
  307. \fBwinfo rooty \fIwindow\fR
  308. Returns a decimal string giving the y-coordinate, in the root
  309. window of the screen, of the
  310. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  311. has no border).
  312. .TP
  313. \fBwinfo screen \fIwindow\fR
  314. Returns the name of the screen associated with \fIwindow\fR, in
  315. the form \fIdisplayName\fR.\fIscreenIndex\fR.
  316. .TP
  317. \fBwinfo screencells \fIwindow\fR
  318. .VS
  319. Returns a decimal string giving the number of cells in the default
  320. color map for \fIwindow\fR's screen.
  321. .TP
  322. \fBwinfo screendepth \fIwindow\fR
  323. Returns a decimal string giving the depth of the root window
  324. of \fIwindow\fR's screen.
  325. .TP
  326. \fBwinfo screenheight \fIwindow\fR
  327. Returns a decimal string giving the height of \fIwindow\fR's screen,
  328. in pixels.
  329. .TP
  330. \fBwinfo screenmmheight \fIwindow\fR
  331. Returns a decimal string giving the height of \fIwindow\fR's screen,
  332. in millimeters.
  333. .TP
  334. \fBwinfo screenmmwidth \fIwindow\fR
  335. Returns a decimal string giving the width of \fIwindow\fR's screen,
  336. in millimeters.
  337. .TP
  338. \fBwinfo screenvisual \fIwindow\fR
  339. Returns one of the following strings to indicate the default visual
  340. type for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR,
  341. \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
  342. \fBtruecolor\fR.
  343. .TP
  344. \fBwinfo screenwidth \fIwindow\fR
  345. Returns a decimal string giving the width of \fIwindow\fR's screen,
  346. in pixels.
  347. .TP
  348. \fBwinfo toplevel \fIwindow\fR
  349. Returns the path name of the top-level window containing \fIwindow\fR.
  350. .VE
  351. .TP
  352. \fBwinfo width \fIwindow\fR
  353. Returns a decimal string giving \fIwindow\fR's width in pixels.
  354. .TP
  355. \fBwinfo x \fIwindow\fR
  356. Returns a decimal string giving the x-coordinate, in \fIwindow\fR's
  357. parent, of the
  358. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  359. has no border).
  360. .TP
  361. \fBwinfo y \fIwindow\fR
  362. Returns a decimal string giving the y-coordinate, in \fIwindow\fR's
  363. parent, of the
  364. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  365. has no border).
  366.  
  367. .SH KEYWORDS
  368. atom, children, class, geometry, height, identifier, information, interpreters,
  369. mapped, parent, path name, screen, width, window
  370.